<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Login</title>
    <link rel="stylesheet" href="static/css/style.css" />
  </head>
  <body>
    <div class="container">
      <div class="form-container" id="login-container">
        <form id="login-form">
          <h2>登录</h2>
          <input type="text" placeholder="用户名" name="username" required />
          <input type="password" placeholder="密码" name="password" required />
          <button type="button" onclick="submitLogin(event)">登录</button>
          <p id="login-errMsg" style="color: red"></p>
          <p>还没有账号？<a href="#" onclick="switchToRegister()">注册</a></p>
        </form>
      </div>

      <div class="form-container hidden" id="register-container">
        <form id="register-form">
          <h2>注册</h2>
          <input type="text" placeholder="用户名" name="register_username" required />
          <input type="password" placeholder="密码" name="register_password" required />
          <input type="password" placeholder="确认密码" name="register_confirm_password" required />
          <button type="button" onclick="submitRegister(event)">注册</button>
          <p id="register-errMsg" style="color: red"></p>
          <p>已有账号？<a href="#" onclick="switchToLogin()">登录</a></p>
        </form>
      </div>
    </div>
    <script src="static/js/script.js"></script>
  </body>
</html>
